home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / swingall.jar / javax / swing / plaf / basic / BasicDesktopPaneUI$CloseAction.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-07-15  |  1014 b   |  36 lines

  1. package javax.swing.plaf.basic;
  2.  
  3. import java.awt.event.ActionEvent;
  4. import java.beans.PropertyVetoException;
  5. import javax.swing.AbstractAction;
  6. import javax.swing.JInternalFrame;
  7.  
  8. public class BasicDesktopPaneUI$CloseAction extends AbstractAction {
  9.    // $FF: synthetic field
  10.    private final BasicDesktopPaneUI this$0;
  11.  
  12.    protected BasicDesktopPaneUI$CloseAction(BasicDesktopPaneUI var1) {
  13.       this.this$0 = var1;
  14.    }
  15.  
  16.    public void actionPerformed(ActionEvent var1) {
  17.       JInternalFrame[] var2 = this.this$0.desktop.getAllFrames();
  18.       JInternalFrame var3 = null;
  19.       if (var2.length > 0) {
  20.          var3 = var2[0];
  21.       }
  22.  
  23.       if (var3 != null && var3.isClosable()) {
  24.          try {
  25.             var3.setClosed(true);
  26.          } catch (PropertyVetoException var4) {
  27.          }
  28.       }
  29.  
  30.    }
  31.  
  32.    public boolean isEnabled() {
  33.       return true;
  34.    }
  35. }
  36.